/* ******************************************************************
 * This file is part of the escal project and distributed under the
 * terms of the GNU General Public License Version 3
 * Copyright (C) 2008 Epocher (xijiaosdq@gmail.com)
 * See COPYING file for licensing information.
 *******************************************************************/

#include "network_config.h"
#include "config_widget.h"
#include <QVBoxLayout>
#include <QGridLayout>

NetworkConfig::NetworkConfig(QWidget *parent)
	:BaseConfigWindow(parent)
{
	setupUi(this);
	BaseConfigWidget *widget, *tmpWidget;

	ProxyBoxLayout = new QGridLayout(proxyBox);
	proxyBox->setLayout(ProxyBoxLayout);
	widget = new BoolConfigWidget("Network/UseProxy",
		tr("Use Proxy"),proxyBox);
	((QGridLayout*)ProxyBoxLayout)->addWidget(widget, 0, 0, 1, 2);
	widgetList<<widget;
	tmpWidget=widget;
	widget = new StringConfigWidget("Network/ProxyServerAddr",
		tr("Address"),proxyBox, (BoolConfigWidget*)tmpWidget);
	((QGridLayout*)ProxyBoxLayout)->addWidget(widget, 1, 0, 1, 1);
	widgetList<<widget;
	widget = new IntegerConfigWidget("Network/ProxyServerPort",
		tr("Port"),0, 65535, QString(), 
		proxyBox, (BoolConfigWidget*)tmpWidget);
	((QGridLayout*)ProxyBoxLayout)->addWidget(widget, 1, 1, 1, 1);
	widgetList<<widget;

};


